home *** CD-ROM | disk | FTP | other *** search
- Path: informatik.tu-muenchen.de!fischerj
- From: fischerj@informatik.tu-muenchen.de (Juergen "Rally" Fischer)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: PPC compilers
- Date: 25 Jan 1996 15:36:54 GMT
- Organization: Technische Universitaet Muenchen, Germany
- Distribution: world
- Message-ID: <4e882m$k7u@sunsystem5.informatik.tu-muenchen.de>
- References: <4d42gg$i2p@ra.ibr.cs.tu-bs.de> <4dov8s$rc5@ar.ar.com.au> <38232132@kone.fipnet.fi> <1205.6597T1252T932@ifi.uio.no>
- NNTP-Posting-Host: hphalle5h.informatik.tu-muenchen.de
- Originator: fischerj@hphalle5h.informatik.tu-muenchen.de
-
-
- In article <1205.6597T1252T932@ifi.uio.no>, ludvigp@ifi.uio.no (Ludvig Pedersen) writes:
- |> Organization: Dept. of Informatics, University of Oslo, Norway
- |> Lines: 39
- |> Message-ID: <1205.6597T1252T932@ifi.uio.no>
- |> References: <4d42gg$i2p@ra.ibr.cs.tu-bs.de> <4dov8s$rc5@ar.ar.com.au> <38232132@kone.fipnet.fi>
- |> NNTP-Posting-Host: gymir.ifi.uio.no
- |> X-Newsreader: THOR 2.22 (Amiga;TCP/IP)
- |>
- |>
- |> >> To do fast 16:16 bit fixed point maths (ie for bitmap scaling). You have
- |> >> the fraction in the high word and the integer part in the low word.
- |> >>áBecause of the addx, every time the fraction wraps around, the X bit is set
- |> >>áand next add, the integer bit is incremented.
- |> >Addx is really great .. Hmm. We could think of all the
- |> >situations where addx could possibly go wrong. (I mean
- |> >fixed point interpolations)
- |> >At least this has to be done before the loop:
- |> > moveq #0,d0
- |> > add.l d1,d0
- |>
- |> > ...
- |> >.loop addx.l d1,d2
- |> > dbf d7,.loop
- |>
- |> >But what about if there is two addx? Theis decimal parts
- |> >have to be switched, which is done nicely with eor
- |> >before swapping, but what about that before loop
- |> >correction? Of course this perfect accuracy
- |> >is not required on 16.16 fixed point but if
- |> >there is a smaller amount of fraction, the
- |> >errors can be quite big..
- |>
- |> Using
- |> sub.w dx,dx
- |>
- |> instead of
- |>
- |> moveq #0,d0
- |> add.l d1,d0
-
- what about cmp.x dx,dx
- won't trash dx ;) the aim was to get X flag 0 right ?
-
- mhm in my routine I had to do a previous add in the outer loop, it did
- same addition like the inner, BUT only on lo fraction.
-
- So I cause the X that actually will be needed by the inner loop addx
- (Without previous add, the addx will cause the X it would have needed
- before!).
-
- Clearing X maybe gives less noise, but not correct :)
- hope I'm talking about same things like you... ;)
-
- |>
- |> is faster by-the-way. And since we are only using the lower word of the
- |> register we don't need to use an extra dataregister.
-
- sub.b dx,dx would even have trashed only the lower _byte_ ;)
- but all instructions tend to need lower byte ;)
-
- |>
- |> <sb>Ludde - Amiga Demo Coder
- |> <sb>Virtual Reality & Official Be developer
- |> <sb>ludvigp@ifi.uio.no
- |>
- ------------------------------------------------------------------------
- fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer) =:)
-
-